BUS ERROR Collective - Shrink Ray

Hello! I'm DJ_Level_3, the newest member of BUS ERROR Collective, and this is the technical background document for my first
contribution the demoscene!

At the time of writing this, it's 9 hours until the deadline and about 15 hours since I decided I wanted to try size coding, or demo
making, for that matter. This means I'm going from an outsider to an entrant in roughly 24 hours, so don't expect too much out of my
very first demo!

Key Concepts:
- An analog oscilloscope measures voltages over time. It does this by sweeping a beam of electrons across a phosphorescent screen,
  and deflecting said beam up and down depending on the input voltage. However, many dual-channel analog oscilloscopes have an X-Y
  mode, where you use two voltages to deflect the beam horizontally and vertically. The two voltages, X and Y, define the horizontal
  and vertical positions of the beam respectively.
- A stereo audio signal, coming from a sound card, is also a pair of voltages over time. If the voltages change in a repeated pattern
  at a constant rate, and control the deflection of a speaker cone, you hear it as sound.
- Using a modified audio cable, or a set of adapters, you can connect the output of a sound card to the inputs of an oscilloscope,
  allowing the beam to draw patterns, if the audio is designed to create such patterns. This is the concept behind vector graphics,
  such as the Atari Asteroids arcade game or Tennis for Two, one of the oldest videogames (which actually used an oscilloscope as its
  display!)
- Using these concepts, the idea of oscilloscope music and art, where you use sound to create art on an oscilloscope, basically falls
  out of the base ideas!
  
Techniques:
- The demo is built on https://madethisthing.com/iq/Demo-Framework-64k, which gives OpenGL and audio output. The OpenGL is basically
  unused here, I only used it to clear the application window, but the audio output is used extensively. The main loop of the demo
  essentially has 3 parts: The scaling effect, the center logo, and the lines/circles.
- The scaling effect is very simple, it just multiplies every sample in the line/circle part of the buffer by a number that's just
  less than 1 to scale them down, and it modulates that number over time with both a fast modulation and a much slower one. This
  happens 100 times per second, so it looks pretty smooth.
- The center logo is pretty simple too, there's a section of the audio buffer that is dedicated to the logos, and every 5 seconds
  the demo switches out what's in that part of the buffer, while leaving the part with the lines/circles untouched.
- The lines and circles are the least simple part, but that's honestly not saying much. 20 times per second, it increments through
  the buffer of lines and circles by 128 samples, looping around at the end, and replaces whatever's there with either a line or a
  circle, exactly 128 frames in duration, with position and size all random.
- To get the size of the executable down, I used Crinkler (https://github.com/runestubbe/Crinkler) as the linker to compress
  everything down. To be honest, I was aiming to enter into the 8k category, but I'm not complaining that it got way under 4k!
  
References:
- Demo framework: https://madethisthing.com/iq/Demo-Framework-64k
- Compressing linker: https://github.com/runestubbe/Crinkler

To Display:
- Hook an oscilloscope's probes to a stripped audio cable, with channel 1 connected the left audio channel, and channel 2 on the
  right channel.
- Set the oscilloscope into X-Y mode, with DC coupling enabled and roughly 0.2V/Div on each channel. This voltage will depend on
  the sound card you use, so don't take my word as law! If it's too big, increase the volts per division, and if it's too small, do
  the opposite.
- Connect the audio cable to a computer as the default output, and run shrink-ray.exe!
- Alternately, view the attached video files. shrink-ray-software.mp4 uses a software oscilloscope, which very accurately simulates
  the look of the hardware, while shrink-ray-hardware.mp4 is taken on a real hardware oscilloscope. The videos don't match up frame
  by frame because the demo uses random numbers, and the recordings were not made at the same time.